package com.bwie.mapper;

import com.bwie.common.domain.*;
import com.bwie.common.domain.request.LottoListReq;
import com.bwie.common.domain.request.LottoLogListReq;
import com.bwie.common.domain.request.RuleLogListReq;
import com.bwie.common.domain.response.RuleLogRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

/**
 * @className: LottoMapper
 * @Description: TODO
 * @version: v1.８.0
 * @author: 汪菲阳
 * @date: 2025/8/26 17:47
 */
@Mapper
public interface LottoMapper {
    List<Lotto> lottoList(LottoListReq lottoListReq);

    List<LottoLog> lottoLogList(LottoLogListReq lottoLogListReq);

    List<Dic> getDic(@Param("dicType") String dicType);

    void addLotto(Lotto lotto);

    void addRuleLog(@Param("ruleLogList") List<RuleLog> ruleLogList);

    List<Rule> ruleList();

    Integer singInCount(@Param("userId") Integer userId, @Param("today") LocalDate today);

    void updPoints(@Param("userId") Integer userId, @Param("newTotalPoints") Integer newTotalPoints);

    User selectByUserId(@Param("userId") Integer userId);

    void insertPointsLog(PointsLog pointsLog);

    Lotto selectLottoInfo(@Param("lottoId") Integer lottoId);

    Integer selectIntergrateByUserId(@Param("userId") Integer userId);

    RuleLogRes selectPrizeInfo(@Param("lottoId") Integer lottoId, @Param("luckyNumber") double luckyNumber);

    void updUserIntegral(@Param("consumePoints") Integer consumePoints, @Param("userId") Integer userId);

    void addLottoLog(LottoLog lottoLog);

    Integer subtractNumByRuleId(@Param("ruleId") Integer ruleId);

    List<RuleLogListReq> ruleLogList(@Param("lottoId") Integer lottoId);

    Integer getUserIntegral(@Param("consumePoints") Integer consumePoints, @Param("userId") Integer userId);
}
